#!/bin/bash

# the result of the comand is stdout
# this command cannot produce any output exept the result

#collect all error_evidence files
# each file has structure XXX/error_evidence_SESSION_NUMBER


< <(for i in $(seq $ADAPT_SESSION_SP -1 1)
  do
    cat $ADAPT_CMD_ERROR_EVIDENCE_TEMPLATE$i 2>&-
  done) \
  sed -r -f \
  <(adapt oop self get_ehandlers |
    sed 's/\//\\\//g;s/~>/\//g
         s/.*/s\/&\/;tprint/'
    echo 'd; :print; P; D')
